const App = getApp();

Page({
	data: {
		logged: !1,
		modalName:'Modal'
	},
    onLoad(option) {
	    if (option){
	      this.setData({
	         globalOption: option
	      })
	    }
    },
    onShow() {

    },

	denglu(e)
	{
		wx.getUserProfile({
			desc:'获取用户相关信息',
			success: res => {
				App.globalData.userInfo = res.userInfo
				console.log(App.globalData.userInfo);

				//调用数据
				let param = {
					mname:App.globalData.userInfo.nickName,
					addr:App.globalData.userInfo.avatarUrl
				};

				//调用数据
				App.HttpService.getData(param,"/members_Add").then(data=>{

					wx.setStorageSync("mid",data[0].jieguo);

					App.WxService.showToast({
						title: "登录成功!",
						icon: 'success',
						duration: 1500,
					});
					setTimeout(function() {

					}, 1500)


					this.setData({
						modalName: null
					})
				});


			}
		})
	},

	hideModal(e) {
		this.setData({
			modalName: null
		})
	},
})